
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>设计模式 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Component-based.html" />
    
    
    <link rel="prev" href="Project-organization.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    关于
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part I</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="Data-structure.html">
            
                <a href="Data-structure.html">
            
                    
                    数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="Arithmetic.html">
            
                <a href="Arithmetic.html">
            
                    
                    算法
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part II</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="Foundation.html">
            
                <a href="Foundation.html">
            
                    
                    Foundation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="UIKit.html">
            
                <a href="UIKit.html">
            
                    
                    UIKit
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="WebView.html">
            
                <a href="WebView.html">
            
                    
                    WebView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="Memory-management.html">
            
                <a href="Memory-management.html">
            
                    
                    内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="Message-passing.html">
            
                <a href="Message-passing.html">
            
                    
                    消息传递的方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="Network.html">
            
                <a href="Network.html">
            
                    
                    网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="Data-storage.html">
            
                <a href="Data-storage.html">
            
                    
                    数据存储
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="Multi-thread.html">
            
                <a href="Multi-thread.html">
            
                    
                    多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="Animation.html">
            
                <a href="Animation.html">
            
                    
                    动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="Image-processing.html">
            
                <a href="Image-processing.html">
            
                    
                    图像处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="Data-encryption.html">
            
                <a href="Data-encryption.html">
            
                    
                    数据安全及加密
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="Runtime.html">
            
                <a href="Runtime.html">
            
                    
                    Runtime
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="Runloop.html">
            
                <a href="Runloop.html">
            
                    
                    Runloop
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part III</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="Project-organization.html">
            
                <a href="Project-organization.html">
            
                    
                    项目架构
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="4.2" data-path="Design-patterns.html">
            
                <a href="Design-patterns.html">
            
                    
                    设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="Component-based.html">
            
                <a href="Component-based.html">
            
                    
                    组件化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="Debug-tips.html">
            
                <a href="Debug-tips.html">
            
                    
                    调试技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="Performance-optimization.html">
            
                <a href="Performance-optimization.html">
            
                    
                    性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="Source-code.html">
            
                <a href="Source-code.html">
            
                    
                    源码理解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="Code-management.html">
            
                <a href="Code-management.html">
            
                    
                    代码管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="Continuous-integration.html">
            
                <a href="Continuous-integration.html">
            
                    
                    持续集成
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >设计模式</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;">&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;</h1>
<h2 id="1ios&#x6709;&#x54EA;&#x4E9B;&#x5E38;&#x89C1;&#x7684;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;">1.iOS&#x6709;&#x54EA;&#x4E9B;&#x5E38;&#x89C1;&#x7684;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;?</h2>
<ul>
<li><p>&#x5355;&#x4F8B;&#x6A21;&#x5F0F;&#xFF1A;&#x5355;&#x4F8B;&#x4FDD;&#x8BC1;&#x4E86;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x5185;&#x4EC5;&#x6709;&#x4E00;&#x4E2A;&#x8BE5;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;,&#x800C;&#x4E14;&#x6613;&#x4E8E;&#x5916;&#x754C;&#x8BBF;&#x95EE;.&#x5728;ios sdk&#x4E2D;,UIApplication, NSBundle, NSNotificationCenter, NSFileManager, NSUserDefault, NSURLCache&#x7B49;&#x90FD;&#x662F;&#x5355;&#x4F8B;.</p>
</li>
<li><p>&#x59D4;&#x6258;&#x6A21;&#x5F0F;&#xFF1A;&#x59D4;&#x6258;Delegate&#x662F;&#x534F;&#x8BAE;&#x7684;&#x4E00;&#x79CD;,&#x901A;&#x8FC7;@protocol&#x65B9;&#x5F0F;&#x5B9E;&#x73B0;&#xFF0C;&#x5E38;&#x89C1;&#x7684;&#x6709;tableView&#xFF0C;textField&#x7B49;&#x3002;</p>
</li>
<li><p>&#x89C2;&#x5BDF;&#x8005;&#x6A21;&#x5F0F;&#xFF1A;&#x89C2;&#x5BDF;&#x8005;&#x6A21;&#x5F0F;&#x5B9A;&#x4E49;&#x4E86;&#x4E00;&#x79CD;&#x4E00;&#x5BF9;&#x591A;&#x7684;&#x4F9D;&#x8D56;&#x5173;&#x7CFB;&#xFF0C;&#x8BA9;&#x591A;&#x4E2A;&#x89C2;&#x5BDF;&#x8005;&#x5BF9;&#x8C61;&#x540C;&#x65F6;&#x76D1;&#x542C;&#x67D0;&#x4E00;&#x4E2A;&#x4E3B;&#x9898;&#x5BF9;&#x8C61;&#x3002;&#x5728;iOS&#x4E2D;,&#x89C2;&#x5BDF;&#x8005;&#x6A21;&#x5F0F;&#x7684;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#x6709;&#x4E24;&#x79CD;: &#x901A;&#x77E5;&#x673A;&#x5236;(notification)&#x548C;KVO&#x673A;&#x5236;(Key-value Observing)</p>
</li>
</ul>
<h2 id="2&#x5355;&#x4F8B;&#x4F1A;&#x6709;&#x4EC0;&#x4E48;&#x5F0A;&#x7AEF;&#xFF1F;">2.&#x5355;&#x4F8B;&#x4F1A;&#x6709;&#x4EC0;&#x4E48;&#x5F0A;&#x7AEF;&#xFF1F;</h2>
<ul>
<li><p>&#x4E3B;&#x8981;&#x4F18;&#x70B9;&#xFF1A;</p>
<p>  1&#x3001;&#x63D0;&#x4F9B;&#x4E86;&#x5BF9;&#x552F;&#x4E00;&#x5B9E;&#x4F8B;&#x7684;&#x53D7;&#x63A7;&#x8BBF;&#x95EE;&#x3002;</p>
<p>  2&#x3001;&#x7531;&#x4E8E;&#x5728;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4E2D;&#x53EA;&#x5B58;&#x5728;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x56E0;&#x6B64;&#x53EF;&#x4EE5;&#x8282;&#x7EA6;&#x7CFB;&#x7EDF;&#x8D44;&#x6E90;&#xFF0C;&#x5BF9;&#x4E8E;&#x4E00;&#x4E9B;&#x9700;&#x8981;&#x9891;&#x7E41;&#x521B;&#x5EFA;&#x548C;&#x9500;&#x6BC1;&#x7684;&#x5BF9;&#x8C61;&#x5355;&#x4F8B;&#x6A21;&#x5F0F;&#x65E0;&#x7591;&#x53EF;&#x4EE5;&#x63D0;&#x9AD8;&#x7CFB;&#x7EDF;&#x7684;&#x6027;&#x80FD;&#x3002;</p>
<p>  3&#x3001;&#x5141;&#x8BB8;&#x53EF;&#x53D8;&#x6570;&#x76EE;&#x7684;&#x5B9E;&#x4F8B;&#x3002;</p>
</li>
<li><p>&#x4E3B;&#x8981;&#x7F3A;&#x70B9;&#xFF1A;</p>
<p>  1&#x3001;&#x7531;&#x4E8E;&#x5355;&#x5229;&#x6A21;&#x5F0F;&#x4E2D;&#x6CA1;&#x6709;&#x62BD;&#x8C61;&#x5C42;&#xFF0C;&#x56E0;&#x6B64;&#x5355;&#x4F8B;&#x7C7B;&#x7684;&#x6269;&#x5C55;&#x6709;&#x5F88;&#x5927;&#x7684;&#x56F0;&#x96BE;&#x3002;</p>
<p>  2&#x3001;&#x5355;&#x4F8B;&#x7C7B;&#x7684;&#x804C;&#x8D23;&#x8FC7;&#x91CD;&#xFF0C;&#x5728;&#x4E00;&#x5B9A;&#x7A0B;&#x5EA6;&#x4E0A;&#x8FDD;&#x80CC;&#x4E86;&#x201C;&#x5355;&#x4E00;&#x804C;&#x8D23;&#x539F;&#x5219;&#x201D;&#x3002;</p>
<p>  3&#x3001;&#x6EE5;&#x7528;&#x5355;&#x4F8B;&#x5C06;&#x5E26;&#x6765;&#x4E00;&#x4E9B;&#x8D1F;&#x9762;&#x95EE;&#x9898;&#xFF0C;&#x5982;&#x4E3A;&#x4E86;&#x8282;&#x7701;&#x8D44;&#x6E90;&#x5C06;&#x6570;&#x636E;&#x5E93;&#x8FDE;&#x63A5;&#x6C60;&#x5BF9;&#x8C61;&#x8BBE;&#x8BA1;&#x4E3A;&#x7684;&#x5355;&#x4F8B;&#x7C7B;&#xFF0C;&#x53EF;&#x80FD;&#x4F1A;&#x5BFC;&#x81F4;&#x5171;&#x4EAB;&#x8FDE;&#x63A5;&#x6C60;&#x5BF9;&#x8C61;&#x7684;&#x7A0B;&#x5E8F;&#x8FC7;&#x591A;&#x800C;&#x51FA;&#x73B0;&#x8FDE;&#x63A5;&#x6C60;&#x6EA2;&#x51FA;&#xFF1B;&#x5982;&#x679C;&#x5B9E;&#x4F8B;&#x5316;&#x7684;&#x5BF9;&#x8C61;&#x957F;&#x65F6;&#x95F4;&#x4E0D;&#x88AB;&#x5229;&#x7528;&#xFF0C;&#x7CFB;&#x7EDF;&#x4F1A;&#x8BA4;&#x4E3A;&#x662F;&#x5783;&#x573E;&#x800C;&#x88AB;&#x56DE;&#x6536;&#xFF0C;&#x8FD9;&#x5C06;&#x5BFC;&#x81F4;&#x5BF9;&#x8C61;&#x72B6;&#x6001;&#x7684;&#x4E22;&#x5931;&#x3002;</p>
</li>
</ul>
<h2 id="3&#x7F16;&#x7A0B;&#x4E2D;&#x7684;&#x516D;&#x5927;&#x8BBE;&#x8BA1;&#x539F;&#x5219;&#xFF1F;">3.&#x7F16;&#x7A0B;&#x4E2D;&#x7684;&#x516D;&#x5927;&#x8BBE;&#x8BA1;&#x539F;&#x5219;&#xFF1F;</h2>
<ul>
<li><p>1.&#x5355;&#x4E00;&#x804C;&#x8D23;&#x539F;&#x5219;</p>
<p>  &#x901A;&#x4FD7;&#x5730;&#x8BB2;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x7C7B;&#x53EA;&#x505A;&#x4E00;&#x4EF6;&#x4E8B;</p>
<p>  CALayer&#xFF1A;&#x52A8;&#x753B;&#x548C;&#x89C6;&#x56FE;&#x7684;&#x663E;&#x793A;&#x3002;</p>
<p>  UIView&#xFF1A;&#x53EA;&#x8D1F;&#x8D23;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x3001;&#x4E8B;&#x4EF6;&#x54CD;&#x5E94;&#x3002;</p>
</li>
<li><p>2.&#x5F00;&#x95ED;&#x539F;&#x5219;</p>
<p>  &#x5BF9;&#x4FEE;&#x6539;&#x5173;&#x95ED;&#xFF0C;&#x5BF9;&#x6269;&#x5C55;&#x5F00;&#x653E;&#x3002; &#x8981;&#x8003;&#x8651;&#x5230;&#x540E;&#x7EED;&#x7684;&#x6269;&#x5C55;&#x6027;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x5728;&#x539F;&#x6709;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x6765;&#x56DE;&#x4FEE;&#x6539;</p>
</li>
<li><p>3.&#x63A5;&#x53E3;&#x9694;&#x79BB;&#x539F;&#x5219;</p>
<p>  &#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x4E13;&#x95E8;&#x7684;&#x534F;&#x8BAE;&#x3001;&#x800C;&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x5E9E;&#x5927;&#x81C3;&#x80BF;&#x7684;&#x534F;&#x8BAE;&#xFF0C;&#x5982; UITableviewDelegate + UITableViewDataSource</p>
</li>
<li><p>4.&#x4F9D;&#x8D56;&#x5012;&#x7F6E;&#x539F;&#x5219;</p>
<p>  &#x62BD;&#x8C61;&#x4E0D;&#x5E94;&#x8BE5;&#x4F9D;&#x8D56;&#x4E8E;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#x3001;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#x53EF;&#x4EE5;&#x4F9D;&#x8D56;&#x4E8E;&#x62BD;&#x8C61;&#x3002; &#x8C03;&#x7528;&#x63A5;&#x53E3;&#x611F;&#x89C9;&#x4E0D;&#x5230;&#x5185;&#x90E8;&#x662F;&#x5982;&#x4F55;&#x64CD;&#x4F5C;&#x7684;</p>
</li>
<li><p>5.&#x91CC;&#x6C0F;&#x66FF;&#x6362;&#x539F;&#x5219;</p>
<p>  &#x7236;&#x7C7B;&#x53EF;&#x4EE5;&#x88AB;&#x5B50;&#x7C7B;&#x65E0;&#x7F1D;&#x66FF;&#x6362;&#xFF0C;&#x4E14;&#x539F;&#x6709;&#x7684;&#x529F;&#x80FD;&#x4E0D;&#x53D7;&#x4EFB;&#x4F55;&#x5F71;&#x54CD; &#x5982;&#xFF1A;KVO</p>
</li>
<li><p>6.&#x8FEA;&#x7C73;&#x7279;&#x6CD5;&#x5219;</p>
<p>  &#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x5E94;&#x5F53;&#x5BF9;&#x5176;&#x4ED6;&#x5BF9;&#x8C61;&#x5C3D;&#x53EF;&#x80FD;&#x5C11;&#x7684;&#x4E86;&#x89E3;&#xFF0C;&#x5B9E;&#x73B0;&#x9AD8;&#x805A;&#x5408;&#x3001;&#x4F4E;&#x8026;&#x5408;</p>
</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Project-organization.html" class="navigation navigation-prev " aria-label="Previous page: 项目架构">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Component-based.html" class="navigation navigation-next " aria-label="Next page: 组件化">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"设计模式","level":"4.2","depth":1,"next":{"title":"组件化","level":"4.3","depth":1,"path":"Component-based.md","ref":"Component-based.md","articles":[]},"previous":{"title":"项目架构","level":"4.1","depth":1,"path":"Project-organization.md","ref":"Project-organization.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Design-patterns.md","mtime":"2020-04-13T10:23:32.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-27T09:12:21.691Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

